#include "MenuState.h"
#include "GameEngine.h"
#include "GameState.h"
#include "PlayState.h"

namespace Advanced2D
{
	CMenuState CMenuState::m_MenuState;

	void CMenuState::Init()
	{
		menu=new Texture();
		menu->Load("08.png");

	}

	void CMenuState::Cleanup()
	{
		
	}

	void CMenuState::Pause()
	{
		
	}

	void CMenuState::Resume()
	{
		
	}

	void CMenuState::HandleEvents(CGameEngine* game)
	{
		
	}

	void CMenuState::Update(CGameEngine* game) 
	{
		if (game->getInputHandler()->IsKeyDown(DIK_B))
		{
			game->ChangeState(CPlayState::Instance());
		}
	}

	void CMenuState::Draw(CGameEngine* game) 
	{
		game->ClearScene(D3DCOLOR_XRGB(0,0,0));
		game->getSpriteHandler()->Draw(menu->GetTexture(),NULL,NULL,NULL,D3DCOLOR_XRGB(255,255,255));
	}

}
